-
Notifications
You must be signed in to change notification settings - Fork 133
Fixup StackedSearchPathLookupError error message #779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixup StackedSearchPathLookupError error message #779
Conversation
The target file that could not be found was printing `Path(_str: "libclang.so")` instead of `libclang.so`. Add the `.str` to the `Path` so just the filename is printed.
| case let .unableToFind(subject, operatingSystem, searchPaths): | ||
| let candidates = searchPaths.flatMap { $0.paths.map { $0.join(subject.fileName(operatingSystem: operatingSystem)).str }} | ||
| return "unable to find \(subject.fileName(operatingSystem: operatingSystem)) among search paths: \(candidates.joined(separator: ", "))" | ||
| return "unable to find \(subject.fileName(operatingSystem: operatingSystem).str) among search paths: \(candidates.joined(separator: ", "))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: could we add a small test to ensure we don't regress here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's worth it because the string form of error messages is not considered stable -- if we changed it again we'd just change the test here too and break downstream anyways.
|
@swift-ci test |
| case let .unableToFind(subject, operatingSystem, searchPaths): | ||
| let candidates = searchPaths.flatMap { $0.paths.map { $0.join(subject.fileName(operatingSystem: operatingSystem)).str }} | ||
| return "unable to find \(subject.fileName(operatingSystem: operatingSystem)) among search paths: \(candidates.joined(separator: ", "))" | ||
| return "unable to find \(subject.fileName(operatingSystem: operatingSystem).str) among search paths: \(candidates.joined(separator: ", "))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's worth it because the string form of error messages is not considered stable -- if we changed it again we'd just change the test here too and break downstream anyways.
The target file that could not be found was printing
Path(_str: "libclang.so")instead oflibclang.so.Add the
.strto thePathso just the filename is printed.